package com.zd.springcloud.base;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface BaseMapper {

    @Insert("insert into try_log values(#{xid},now())")
    void insertTryLog(String xid);

    @Select("select count(1) from try_log where xid=#{xid}")
    int existsTryLog(String xid);
    //commit
    @Insert("insert into commit_log values(#{xid},now())")
    void insertCommitLog(String xid);
    // commit
    @Select("select count(1) from commit_log where xid=#{xid}")
    int existsCommitLog(String xid);
    //rollback
    @Insert("insert into rollback_log values(#{xid},now())")
    void  insertRollbackLog(String xid);
    // rollback
    @Select("select count(1) from rollback_log where xid=#{xid}")
    int existsRollbackLog(String xid);

}
